// components/addIcon/addBtn.js
Component({
    /**
     * Component properties
     */
    properties: {
        // 判断点击事件的添加类型
        addType: {
            // value = room | device
            type: String,
            value: "null"
        }
    },

    /**
     * Component initial data
     */
    data: {

    },

    /**
     * Component methods
     */
    methods: {
        onAddTap: function () {
            var that = this
            setTimeout(function () {
                that.triggerEvent('addRoom')
            }, 350)
        },
        
        onConfirmTap: function () {
            var that = this
            setTimeout(function () {
                that.triggerEvent('addDevice')
            }, 350)
        },

        add() {
            // console.log(this.properties)
            switch (this.properties.addType) {
                case "room": {
                    console.log("addroom")
                    break;
                }
                case "device": {
                    console.log("adddevice")
                    break;
                }
                default: {
                    console.log("addType undefined")
                    break;
                }
            }
        }
    }
})